package com.yunti.springboot.controller;



import com.yunti.springboot.annotation.Log;
import com.yunti.springboot.annotation.Permission;
import com.yunti.springboot.service.ElectiveSubService;
import com.yunti.springboot.vo.Result;
import com.yunti.springboot.vo.req.ElectiveSubReq;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ytt
 * @since 2023-06-25
 */
@RestController
@RequestMapping("/electiveSub")
public class ElectiveSubController {
   @Resource
   ElectiveSubService service;
    @PostMapping("/getElectiveSubList")
    public Result getElectiveSubList(@RequestBody ElectiveSubReq req) {
        return service.getElectiveSubList(req);
    }

    @Log
    @Permission({"superAdmin"})
    @PostMapping("/add")
    public Result add(@RequestBody ElectiveSubReq req) {
        return service.add(req);
    }

    @Log
    @Permission({"superAdmin"})
    @PostMapping("/edit")
    public Result edit(@RequestBody ElectiveSubReq req) {
        return service.edit(req);
    }

    @Log
    @Permission({"superAdmin"})
    @PostMapping("/del")
    public Result del(@RequestBody ElectiveSubReq req) {
        return service.del(req);
    }

}
